package Chpter4;

class Animal2{
	String name="Animal";
	void shout() {
		System.out.println("Animal shouts.");
	
	}
}
class Dog2 extends Animal2{
	String name="dog";
	void shout() {
		System.out.println("Wang");
		super.shout();
	}
	void printName() {
		System.out.println("name="+name+" Father'name "+super.name);
	}
}

public class Example03 {
	public static void main(String[] args) {
		Dog2 dog=new Dog2();
		dog.shout();
		dog.printName();
		
	}

}
